<?php

namespace app\api\controller;

use app\api\service\Base;
use app\common\service\WebSocket;
use Exception;

class Test extends Base
{
    /**
     * 测试
     */
    public function index()
    {
        try {
            WebSocket::sendToAll('update');
        } catch (Exception $e) {
            $this->error('WebSocket连接失败:' . $e->getMessage());
        }
        $this->success('1');
    }
}